ddb84d5f179b78e5832a0e4dc55dd93da982f278,platform/platform-impl/src/com/intellij/ide/ui/laf/darcula/ui/DarculaRadioButtonUI.java,DarculaRadioButtonUI,paint,#Graphics#JComponent#,46

Before Change


    if (b.isSelected()) {
      g.setColor(b.isEnabled() ? Gray._30 : Gray._60);
      g.fillOval(w/2 - 3, h/2 - 1, 5, 5);
      g.setColor(b.isEnabled() ? Gray._170 : Gray._120);
      g.fillOval(w/2 - 3, h/2 - 2, 5, 5);
    }
    config.restore();
    g.translate(-x, -y);

After Change



  @Override
  public synchronized void paint(Graphics g2d, JComponent c) {
    Graphics2D g = (Graphics2D)g2d;
    AbstractButton b = (AbstractButton) c;
    ButtonModel model = b.getModel();

    Dimension size = c.getSize();
    Font f = c.getFont();
    g.setFont(f);
    FontMetrics fm = SwingUtilities2.getFontMetrics(c, g, f);

    Rectangle viewRect = new Rectangle(size);
    Rectangle iconRect = new Rectangle();
    Rectangle textRect = new Rectangle();

    Insets i = c.getInsets();
    viewRect.x += i.left;
    viewRect.y += i.top;
    viewRect.width -= (i.right + viewRect.x);
    viewRect.height -= (i.bottom + viewRect.y);


    String text = SwingUtilities.layoutCompoundLabel(
      c, fm, b.getText(), getDefaultIcon(),
      b.getVerticalAlignment(), b.getHorizontalAlignment(),
      b.getVerticalTextPosition(), b.getHorizontalTextPosition(),
      viewRect, iconRect, textRect, b.getIconTextGap());

    // fill background
    if(c.isOpaque()) {
      g.setColor(b.getBackground());
      g.fillRect(0,0, size.width, size.height);
    }

    int rad = 5;

    // Paint the radio button
    final int x = iconRect.x + (rad-1)/2;
    final int y = iconRect.y + (rad-1)/2;
    final int w = iconRect.width - (rad + 5) / 2;
    final int h = iconRect.height - (rad + 5) / 2;

    g.translate(x, y);

    //setup AA for lines
    final GraphicsConfig config = GraphicsUtil.setupAAPainting(g);
    g.setPaint(
      UIUtil.getGradientPaint(0, 0, ColorUtil.shift(c.getBackground(), 1.5), 0, c.getHeight(), ColorUtil.shift(c.getBackground(), 1.2)));
    g.fillOval(0, 1, w - 1, h - 1);

    if (b.hasFocus()) {
      int sysOffX = SystemInfo.isMac ? 0 : 1;
      int sysOffY = SystemInfo.isMac ? 0 : -1;
      DarculaUIUtil.paintFocusOval(g, x-rad - 1  + sysOffX, y- (rad + 1)/2 + sysOffY, w-2, h-2);
    } else {
      g.setPaint(UIUtil.getGradientPaint(w / 2, 1, Gray._160.withAlpha(90), w / 2, h, Gray._100.withAlpha(90)));
      g.drawOval(0, 2, w - 1, h - 1);

      g.setPaint(Gray._40.withAlpha(200));
      g.drawOval(0, 1, w - 1, h - 1);
    }

    if (b.isSelected()) {
      final boolean enabled = b.isEnabled();
      g.setColor(UIManager.getColor(enabled ? "RadioButton.darcula.selectionEnabledShadowColor" : "RadioButton.darcula.selectionDisabledShadowColor"));// ? Gray._30 : Gray._60);
      g.fillOval(w/2 - rad/2, h/2 , rad, rad);
      g.setColor(UIManager.getColor(enabled ? "RadioButton.darcula.selectionEnabledColor" : "RadioButton.darcula.selectionDisabledColor")); //Gray._170 : Gray._120);
      g.fillOval(w/2 - rad/2, h/2 - 1, rad, rad);
    }
    config.restore();